 package com.bbcare.comm;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil  extends ThreadLocal<DateFormat>
{

 protected DateFormat initialValue()
  {
    return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 }

  public static final String FORMAT_JAVA_A = "yyyy-MM-dd HH:mm:ss";
  private static ThreadLocal<DateFormat> sf_A = new ThreadLocal()
  {
    protected DateFormat initialValue() { return new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    }
  };
  
  public static String getDateA(Date date) {
   return ((DateFormat)sf_A.get()).format(date);
  }
  
  public static String getSysDateA() {
   Date now = new Date();
     return getDateA(now);
  }
  


  public static String getTimeString(String timeStr)
  {
     String str = timeStr.replaceAll("-", "").replace(":", "").replace(" ", "");
    return str;
  }
}


